<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <title>Event Details</title>
</head>
<body>
<g:if test="${flash.message}">
  <div class="message">${flash.message}</div>
</g:if>
<g:render template="/common/eventDetailTable"/>
<div class="body">
  <h1>Event Unfilled Positions</h1>
  <table>
    <g:render template="/common/positionTableHeader"/>
    <tbody>
    <g:findAll  in="${eventInstance.positions}" expr="it.volunteers.size() < it.numberOfVolunteers">
      <tr class="prop">
        <td valign="top" class="value">${it.name}</td>
        <td valign="top" class="value">${it.description}</td>
        <td valign="top" class="value">${it.location}</td>
        <td valign="top" class="value">${it.startDate}</td>
        <td valign="top" class="value">${it.endDate}</td>
        <td valign="top" class="value">${it.numberOfVolunteers}</td>
        <td valign="top" class="value">
          <ul>
            <g:each var="v" in="${it.volunteers}">
              <li><g:link controller="volunteer" action="show" id="${v.id}">${v?.encodeAsHTML()}</g:link></li>
            </g:each>
          </ul>
        </td>
        <td valign="top">
          <g:link controller="eventPosition" action="signup" id="${it.id}" params="[eventId:eventInstance.id]">Signup</g:link>
        </td>
      </tr>
    </g:findAll>
    </tbody>
  </table>
</div>
</body>
</html>
